// 报表管理
import request from '@/utils/request';
import { rsaEncrypt } from '@/utils/commonUtil3';

// 分页条件查询期初库存
export function getStockReportList(data) {
	return request({
		url: '/reportForms/selectInitial',
		method: 'get',
		params: data
	});
}

// 分页条件查询销售报表
export function getSaleReportList(data) {
	return request({
		url: '/reportForms/selectSell',
		method: 'get',
		params: data
	});
}

// 导出期初库存
export function exportInitial(data) {
	// const data1 = rsaEncrypt(data);
	return request({
		url: '/reportForms/exportInitial',
		method: 'POST',
		responseType: 'blob',
		data: data
	});
}

// 导出销售报表
export function exportSell(data) {
	// const data1 = rsaEncrypt(data);
	return request({
		url: '/reportForms/exportSell',
		responseType: 'blob',
		method: 'POST',
		data: data
	});
}

// 查询供应商标品出库报表详情
export function getSupplierProductOutReport(data) {
	return request({ url: '/reportForms/selectOutBound', method: 'get', params: data });
}

// 查询供应商非标品出库报表
export function getSupplierNonstandardProductOutReport(data) {
	return request({ url: '/reportForms/selectOutBound/fei', method: 'get', params: data });
}

// 导出供应商非标品出库报表
export function exportSupplierNonstandardProductOutReport(data) {
	return request({ url: '/reportForms/exportOutBound/fei', method: 'POST', responseType: 'blob', data: data });
}

// 导出供应商标品出库报表
export function exportSupplierProductOutReport(data) {
	return request({ url: '/reportForms/exportOutBound', method: 'POST', responseType: 'blob', data: data });
}

//  获取所有的供应商（包括删除的）
export function getAllSupplier(data) {
	return request({ url: '/reportForms/selectSupplier', method: 'get', params: data });
}

// 查询供应商标品出库报表详情
export function getSupplierProductInReportDetail(data) {
	return request({ url: '/reportForms/outBoundDetails', method: 'get', params: data });
}

// 查询供应商非标品出库报表详情
export function getSupplierNonstandardProductInReportDetail(data) {
	return request({ url: '/reportForms/outBoundDetails/fei', method: 'get', params: data });
}

// 分页查询门店订单利润报表
export const reqOrderReportList = data => request({ url: '/reportForms/storeOrder/profit', method: 'GET', params: { ...data } });
// 订单报表详情
export const reqOrderDetail = data => request({ url: '/reportForms/storeOrder/details', method: 'GET', params: { ...data } });
// 订单报表导出
export const exportOrderReport = data => request({ url: '/reportForms/export/storeOrder', responseType: 'blob', method: 'POST', data });

// 获取所有门店定位
export const reqStoreGPSList = data => request({ url: '/reportForms/storeInfo', method: 'GET', params: { ...data } });

// 分页查询商品销售统计
export const reqSellStatisticList = data => request({ url: '/reportForms/sellStatistics', method: 'GET', params: { ...data } });

// 导出商品销售统计
export const reqExportSell = data => request({ url: '/reportForms/export/sellStatistics', method: 'POST', responseType: 'blob', data })
// 导出商品销售详情
export const reqExportSellDetail = data => request({ url: '/reportForms/export/sellStatistics/details', method: 'POST', responseType: 'blob', data })
// 商品销售详情
export const reqSellStatisticDetail = data => request({ url: '/reportForms/sellStatistics/details', method: 'GET', params: { ...data } });